<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>样式</title>
    <script src="js/vue.js"></script>
    <style>
        .active {
            color: red;
        }
        .text-error {
            background-color: orange;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="origin" v-bind:class="{ active: isActive, 'text-error': error }">对象语法</div>
        <div class="origin" v-bind:class="classObj">对象语法</div>
        
        <div v-bind:class="[isActive? 'active' : '', errorCless]">数组语法</div>
        <div v-bind:class="[{'active': isActive}, errorCless]">数组语法</div>
    </div>

    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                isActive: false,
                errorCless: 'text-error'
            },
            computed: {
            
            }
        })
    </script>
</body>
</html>